home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / prog / xigcv2_8.taz / xigcv2_8 / GobanP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-08  |  3.0 KB  |  119 lines

  1. /****************************************************************************************************************
  2.  *
  3.  *  Copyright (c) 1992 by Antoine Dumesnil de Maricourt. All rights reserved.
  4.  *
  5.  *  This program is distributed in the hope that it will be useful.
  6.  *  Use and copying of this software and preparation of derivative works
  7.  *  based upon this software are permitted, so long as the following
  8.  *  conditions are met:
  9.  *       o credit to the authors is acknowledged following current
  10.  *         academic behaviour
  11.  *       o no fees or compensation are charged for use, copies, or
  12.  *         access to this software
  13.  *       o this copyright notice is included intact.
  14.  *  This software is made available AS IS, and no warranty is made about 
  15.  *  the software or its performance. 
  16.  * 
  17.  *  Bug descriptions, use reports, comments or suggestions are welcome.
  18.  *  Send them to    dumesnil@etca.fr   or to:
  19.  *       
  20.  *       Antoine de Maricourt
  21.  *       ETCA CREA-SP
  22.  *       16 bis, avenue Prieur de la Cote d'Or
  23.  *       94114 Arcueil Cedex
  24.  *       France
  25.  */
  26.  
  27. #ifndef _GobanP_h
  28. #define _GobanP_h
  29.  
  30. #include "Goban.h"
  31.  
  32. /* include superclass private header file */
  33. #include <X11/CoreP.h>
  34.  
  35. /* define unique representation types not found in <X11/StringDefs.h> */
  36.  
  37. #define XtRGobanResource "GobanResource"
  38.  
  39. typedef struct {
  40.     int empty;
  41. } GobanClassPart;
  42.  
  43. typedef struct _GobanClassRec {
  44.     CoreClassPart    core_class;
  45.     GobanClassPart    goban_class;
  46. } GobanClassRec;
  47.  
  48. extern GobanClassRec gobanClassRec;
  49.  
  50. typedef struct {
  51.   unsigned int free  : 1;
  52.   unsigned int black : 1;
  53.   unsigned int mark1 : 8;
  54.   unsigned int mark2 : 8;
  55.   unsigned int num   : 10;
  56. } PointState;
  57.  
  58. typedef struct {
  59.     /* resources */
  60.  
  61.   Boolean       auto_redisplay;
  62.   Position      bottom;
  63.   int           cursor;
  64.   XFontStruct  *font;
  65.   Pixel         foreground;
  66.   Dimension     game_size;
  67.   Position      left;
  68.   Boolean       display_coordinates;
  69.   Dimension     point_size;
  70.   Boolean       stipple;
  71.   Position      right;
  72.   Position      top;
  73.  
  74.     /* private state */
  75.  
  76.   PointState    points[20][20];
  77.   Position      x_offset;
  78.   Position      y_offset;
  79.  
  80.   Pixmap        black_stone;
  81.   Pixmap        board;
  82.   Pixmap        gray_stone;
  83.   Pixmap        mouse_mask;
  84.   Pixmap        picture;
  85.   Pixmap        white_stone;
  86.  
  87.   GC            background_gc;
  88.   GC            foreground_gc;
  89.   GC            black_fg_gc;
  90.   GC            black_bg_gc;
  91.   GC            black_bd_gc;
  92.   GC            white_fg_gc;
  93.   GC            white_bg_gc;
  94.   GC            white_bd_gc;
  95.   GC            copy_gc;
  96.  
  97.   Cursor        black_cursor;
  98.   Cursor        gray_cursor;
  99.   Cursor        white_cursor;
  100.   Cursor        font_cursor;
  101.  
  102.   Pixel         white_bg;
  103.   Pixel         white_fg;
  104.   Pixel         white_bd;
  105.   Pixel         black_bg;
  106.   Pixel         black_fg;
  107.   Pixel         black_bd;
  108. } GobanPart;
  109.  
  110. typedef struct _GobanRec {
  111.     CorePart    core;
  112.     GobanPart    goban;
  113. } GobanRec;
  114.  
  115. #define Min(x,y)      ((x) > (y) ? (y) : (x))
  116. #define Max(x,y)      ((x) > (y) ? (x) : (y))
  117.  
  118. #endif /* _GobanP_h */
  119.